package com.ysd.lis.controller.lab;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.ysd.common.Result;
import com.ysd.lis.annotation.MainInfoLog;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.lab.LabReqMain;
import com.ysd.lis.request.AddLabMaininfo;
import com.ysd.lis.request.LabMaininfoPageDto;
import com.ysd.lis.request.LabReqAdditionsDto;
import com.ysd.lis.request.PrintBarcodeDto;
import com.ysd.lis.request.lab.LabReqMainChangeWkflwParam;
import com.ysd.lis.request.lab.LabReqMainDto;
import com.ysd.lis.request.lab.LabReqMainReceptionParam;
import com.ysd.lis.service.bak.LabReqMainBakService;
import com.ysd.lis.service.lab.LabReqMainService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 检验申请主表 前端控制器
 * </p>
 *
 * @author HuiXing
 * @since 2023-12-26
 */
@RestController
@RequestMapping("/lab/reqMainBak")
public class LabReqMainBakController extends BaseController {
    @Autowired
    LabReqMainService reqMainService;

    @Autowired
    LabReqMainBakService reqMainBakService;

    @ApiOperation("扫码上机")
    @PostMapping("/insertMaininfoByReqNo")
    @MainInfoLog(operationType = OperationType.INSERT, module = "检验报告", content = "新增标本信息", businessName = "mainInfo")
    public Result insertMaininfoByReqNo(@RequestBody AddLabMaininfo labReqMain) throws JsonProcessingException {
        return reqMainBakService.insertMaininfoByReqNo(labReqMain);
    }


    @ApiOperation("条码信息查询")
    @PostMapping("/barcodePrintQueryOrMaininfo")
    public Result barcodePrintQueryOrMaininfo(@RequestBody PrintBarcodeDto dto) {
        return reqMainBakService.barcodePrintQueryOrMaininfo(dto);
    }

    @ApiOperation("获取历史签收列表")
    @GetMapping("/findLabReqMainReHistory")
    public Result findLabReqMainCollectionHistory(LabMaininfoPageDto maininfoPageDto) {
        return reqMainBakService.findLabReqMainReHistory(maininfoPageDto);
    }

}
